$.windowdimensions = function(){
    var win = jQuery(window);
    var de = jQuery();
     
     var st = document.body.scrollTop,
         sl = document.body.scrollLeft
     
     var wh = win.height(), 
         ww = win.width();

     
     return {
         windowHeight: wh,
         windowWidth: ww,
         documentHeight: de.height(),
         documentWidth: de.width(),
         scrollLeft: sl,
         scrollTop: st,
		 scrollHeight: de[0].scrollHeight,
		 scrollWidth: de[0].scrollWidth,
         windowRight: sl+ ww,
         windowBottom: st+ wh
     }
}